/**
 * @program: yygh_parent
 * @ClassName TaskListener
 * @description:
 * @author: zyw
 * @create: 2023-06-12 22:26
 * @Version 1.0
 **/
package com.atguigu.yygh.order.listener;

import com.atguigu.yygh.mq.MqConst;
import com.atguigu.yygh.order.service.OrderInfoService;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TaskListener {

    @Autowired
    private OrderInfoService orderInfoService;
    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue(value = MqConst.QUEUE_TASK_8, durable = "true"),
                    exchange = @Exchange(value = MqConst.EXCHANGE_DIRECT_TASK),
                    key = MqConst.ROUTING_TASK_8
            ))

    public void patientTips(Message message, Channel channel) {
        orderInfoService.patientTips();
    }

}
 
